import request from "@/utils/request";

// 品牌分类数据类型
export interface categoryItemType {
  id: number;
  name: string;
  category1Id?: number;
  category2Id?: number;
}

// 品牌分类数据列表类型
export type categoryListType = categoryItemType[];

// 请求一级分类列表数据
export const reqGetCategory1List = () => {
  return request.get<null, categoryListType>(`/admin/product/getCategory1`);
};

//  请求二级分类列表数据
export const reqGetCategory2List = (category1Id: number) => {
  return request.get<null, categoryListType>(
    `/admin/product/getCategory2/${category1Id}`
  );
};

// 请求三级分类列表数据
export const reqGetCategory3List = (category2Id: number) => {
  return request.get<null, categoryListType>(
    `/admin/product/getCategory3/${category2Id}`
  );
};
